      function getDG() {
	      var cDG;
	      if (frameElement != null && frameElement.api != null) {
		     var api = frameElement.api, W = api.opener;
		     cDG = W.$;
	      } else {
		     cDG = $;
	      }
	      return cDG;
       }
       
      
      //显示嵌入页面对话框最大化
      function ShowIframeDialogMax(id,title,url,width,height){   	   
  	      url = "url:"+sys_context +"/"+ url;
  	      $.dialog({id:id, title:title, content:url, width:width, height:height, min:true, max:true , lock : true}).max();
     }
     
       //显示嵌入页面对话框
       function ShowIframeDialog(id,title,url,width,height){   	   
   	      url = "url:"+sys_context +"/"+ url;
   	      $.dialog({id:id, title:title, content:url, width:width, height:height, min:true, max:true , lock : true}).max();
      }
      
        //显示网页式对话框
       function ShowIframe(id,title,url,width,height){   	   
//    	   url = "url:"+sys_context +"/"+ url;
//    	   $.dialog({id:id, title:title, content:url, width:width, height:height, 
//    		   min:true, max:true , lock : true});
    	    var params={
    	        resizable : 'yes'
    		};
    	    url = sys_context+"/"+url;   	    
    		openWindow(url, width, height, params);
        }
       //显示子对话框嵌入页面
       function ShowChildIframe(id,title,url,width,height){
    	   url = "url:"+sys_context +"/"+ url;

    	   cDG = null;
    	   //查询界面第一层打开Dialog判断
    	   if (frameElement!=undefined){
    		   var api = frameElement.api;
               
               //在LierUI Tab中加载判断
               if (api==undefined){
            	   if(window.parent.frameElement.api){
            		   var zindexP=window.parent.frameElement.api.DOM.wrap[0].style.zIndex;
            		   cDG = $.dialog({id:id, title:title, content:url,width:width, height:height ,parent:this.iwin,min:false ,max:false,zIndex:(zindexP+1)});
            	   }else{
            		   cDG = $.dialog({id:id, title:title, content:url,width:width, height:height ,parent:this.iwin,min:false ,max:false}); 
            	   }
               } else {
            	   W = api.opener;
            	   cDG = W.$.dialog({id:id,title:title, content:url,width:width, height:height,parent:api.iwin,min:false,max:false,lock:true});
               }
    	   } else {
    		   cDG = $.dialog({id:id, title:title, content:url,width:width, height:height ,parent:this.iwin,min:false ,max:false});
    	   }
       }
       //显示子对话框传入内容
       function ShowChildString(id,title,strHtml,width,height){
    	   var api = frameElement.api, W = api.opener; 
    	   W.$.dialog({id:id,title:title,content:strHtml,width:width,height:height,parent:api.iwin,min:false,max:false,lock: true,cancelVal:'确定',cancel:function(){closeDialog();}});
       }
       //显示内容
       function ShowHtmlString(id,title,strHtml,width,height) {
    	   $.dialog({id:id, title:title, html:strHtml,width:width, height:height,max:false,lock:true});
       }
       //确认对话框
       function ShowConfirm(id,title,url,width,height){
    	   url = "url:"+sys_context+"/"+url;
    	   $.dialog({id:id, title:title, page:url,width:width, height:height,max:false,lock: true});
       }
       //子页面确认对话框
       function ShowChildConfirm(id,title,url,width,height){
    	   url = "url:"+sys_context+"/"+url;
    	   $.dialog({id:id, title:title, page:url,width:width, height:height ,parent:api.iwin,min:false ,max:false,lock: true});
       }
       
       //提示对话框
       function ShowAlert(id,title,alertCon,width,height){
    	   var api = frameElement.api, W = api.opener; 
    	   W.$.dialog({id:id, title:title, content:alertCon,width:width, height:height,min:false ,max:false,cancelVal:'确定',cancel: true ,lock: true});
       }
       
       //子窗口提示对话框
       function ShowChildAlert(id,title,alertCon,width,height){
    	   var api = frameElement.api, W = api.opener; 
    	   W.$.dialog({id:id, title:title, content:alertCon,width:width, height:height,parent:api.iwin,min:false ,max:false,cancelVal:'确定',cancel: true ,lock: true});
       }
       
       //子窗口提示对话框(允许最大化)
       function ShowChildAlertBlowup(id,title,alertCon,width,height){
    	   var api = frameElement.api, W = api.opener; 
    	   W.$.dialog({id:id, title:title, content:alertCon,width:width, height:height,parent:api.iwin,min:false,max:true,cancelVal:'确定',cancel: true,lock: true});
       }
       
        // 关闭对话框
       function CloseDialog(){
    	   if (frameElement!=null){
    		   var api = frameElement.api, W = api.opener; 
        	   if (W.cDG==null){
        		   api.close();
        	   } else {
        		   W.cDG.close();
        	   }
    	   } else {
    		   window.close();
    	   }   	   
       }

       // 关闭指定对话框
       function CloseChildDialog(dialogID){
    	   var api = frameElement.api, W = api.opener; // api.opener 为载加lhgdialog.min.js文件的页面的window对象
    	   api.close();
       }
       
       
       
       function openWindow(url, width, height, params, target){
    	    var left = (screen.availWidth  - width)/2;
    	    var top  = (screen.availHeight - height)/2;

    	    var paramStr = "";
    	    if(typeof params == "undefined" || params == null){
    	        paramStr = "toolbar="     + "no,"
    	                 + "location="    + "no,"
    	                 + "status="      + "no,"
    	                 + "directories=" + "no,"
    	                 + "menubar="     + "no,"
    	                 + "scrollbars="  + "yes,"
    	                 + "resizable="   + "yes,"
    	                 + "left="        + left  + ", "
    	                 + "top="         + top   + ", "
    	                 + "width="       + width + ", "
    	                 + "height="      + height;
    	    }else{
    			var toolbar = (typeof params['toolbar']  == "undefined" || params['toolbar']  == "") ? "no" : params['toolbar'];
    			var locationX = (typeof params['location']  == "undefined" || params['location']  == "") ? "no" : params['location'];
    			var status = (typeof params['status']  == "undefined" || params['status']  == "") ? "no" : params['status'];
    			var directories = (typeof params['directories']  == "undefined" || params['directories']  == "") ? "no" : params['directories'];
    			var menubar = (typeof params['menubar']  == "undefined" || params['menubar']  == "") ? "no" : params['menubar'];
    			var scrollbars = (typeof params['scrollbars']  == "undefined" || params['scrollbars']  == "") ? "no" : params['scrollbars'];
    			var resizable = (typeof params['resizable']  == "undefined" || params['resizable']  == "") ? "no" : params['resizable'];

    	        paramStr = "toolbar="     +  toolbar + ","
    	                 + "location="    + locationX + ","
    	                 + "status="      + status + ","
    	                 + "directories=" + directories + ","
    	                 + "menubar="     + menubar + ","
    	                 + "scrollbars="  + scrollbars + ","
    	                 + "resizable="   + resizable + ","
    	                 + "alwaysRaised="      + "yes,"
    	                 + "z-look="      + "yes,"
    	                 + "left="        + left  + ", "
    	                 + "top="         + top   + ", "
    	                 + "width="       + width + ", "
    	                 + "height="      + height;
    	    }
    		
    		if(typeof target != 'undefined'){
    	        winObj = window.open(url, target, paramStr);
    	    }else{
    	        winObj = window.open(url, "newopen", paramStr);
    	    }
    	    winObj.focus();
    		return winObj;
    	}

    	function openDialogWindow(url, dialogWidth, dialogHeight, params, target){
    	    var dialogLeft = (screen.availWidth  - dialogWidth)/2;
    	    var dialogTop  = (screen.availHeight - dialogHeight)/2;
    	    
    	    
    	    var paramStr = "";
    	    if(typeof params == "undefined" || params == null){
    	        paramStr = "center="		+ "yes;"
    	                 + "help="			+ "no;"
    	                 + "resizable="		+ "no;"
    	                 + "status="		+ "yes;"
    	                 + "scroll="		+ "yes;"
    	                 + "dialogHide="	+ "no;"
    	                 + "edge="			+ "raised;"
    					 + "unadorned="		+ "no;"
    	                 + "dialogLeft="    + dialogLeft  + "px; "
    	                 + "dialogTop="     + dialogTop   + "px; "
    	                 + "dialogWidth="   + dialogWidth + "px; "
    	                 + "dialogHeight="  + dialogHeight + "px;";
    	    }else{
    			
    	        paramStr = "center="		+ ((typeof params['center']		== "undefined" || params['center']		== "") ? "no"	: params['center'])		+ ";"
    	                 + "help="			+ ((typeof params['help']		== "undefined" || params['help']		== "") ? "no"	: params['help'])		+ ";"
    	                 + "resizable="		+ ((typeof params['resizable']  == "undefined" || params['resizable']   == "") ? "no"	: params['resizable'])  + ";"
    	                 + "status="		+ ((typeof params['status']		== "undefined" || params['status']		== "") ? "yes"	: params['status'])		+ ";"
    	                 + "scroll="		+ ((typeof params['scroll']		== "undefined" || params['scroll']		== "") ? "yes"	: params['scroll'])		+ ";"
    	                 + "dialogHide="	+ ((typeof params['dialogHide']	== "undefined" || params['dialogHide']	== "") ? "no"	: params['dialogHide'])	+ ";"
    	                 + "edge="			+ ((typeof params['edge']		== "undefined" || params['edge']		== "") ? "raised"	: params['edge'])	+ ";"
    					 + "unadorned="		+ ((typeof params['unadorned']	== "undefined" || params['unadorned']	== "") ? "no"	: params['unadorned'])	+ ";"
    	                 + "dialogLeft="	+ dialogLeft  + "; "
    	                 + "dialogTop="		+ dialogTop   + "; "
    	                 + "dialogWidth="	+ dialogWidth + "; "
    	                 + "dialogHeight="	+ dialogHeight;
    					 
    	    }
    		
    	    if(typeof target != 'undefined'){
    	        window.showModalDialog(url, target, paramStr);
    	    }else{
    	        window.showModalDialog(url, "", paramStr);
    	    }

    	}
